package com.kgis.system.access.common.service;

import java.util.List;

import com.irm.system.auditlog.log.Auditable;
import com.irm.system.authorization.service.AuthorizationService;
import com.irm.system.authorization.vo.UserContext;
import com.platform.model.Model;
import common.vo.Ordering;

public interface AbstractExecutiveAccessService<T extends Model> extends AuthorizationService {

	/**
	 * 
	 * @param model
	 * @param userContext
	 * @return
	 */
	T create(T model, UserContext userContext);

	/**
	 * 
	 * @param model
	 * @param userContext
	 * @return
	 */
	T update(T model, UserContext userContext);

	/**
	 * 
	 * @param model
	 * @param userContext
	 * @return
	 */
	T delete(T model, UserContext userContext);

	/**
	 * 
	 * @param ordering
	 * @param userContext
	 * @return
	 */
	@Auditable(false)
	List<T> findAll(Ordering ordering, UserContext userContext);

	/**
	 * 
	 * @param userContext
	 * @return
	 */
	@Auditable(false)
	List<T> findAll(UserContext userContext);

	/**
	 * 
	 * @param id
	 * @param userContext
	 * @return
	 */
	@Auditable(false)
	T findById(long id, UserContext userContext);
}
